<?php $this->placeholder('toolBar')->captureStart();?>
<input type="button" class="button" onclick="$('#newsEdit').submit()" value="Сохранить" /> 
<input class="button" type="submit" onclick="goto(url('news/edit'))" name="save_view" value="Отмена"/>
<input class="button" style="float: right;" type="submit" onclick="$('#metaDialog').fadeIn();" name="save_view" value="Мета"/>
<input class="button" style="float: right;" type="submit" onclick="$('#moreDialog').fadeIn();$(document).oneTime(3000, function(){$('#moreDialog').fadeOut()})" name="save_view" value="Дополнительно"/>
<div style="float: right;position: relative;right: 10px;top: -13px;cursor: pointer;">
<?php 
$imagePath = $this->baseUrl('modules/news/picture-55.png');
$imgStyle = "";
if (!empty($this->Row['Picture']))
{
    $imagePath = $this->baseUrl("images/thumb_tiny/" . $this->Row['Picture']) ;
    $imageFullPath = $this->baseUrl("images/thumb_big/" . $this->Row['Picture']) ;
    $imgStyle = "padding: 3px;border: 1px solid #ccc";
}
?>
	
	<a href="<?=$imageFullPath?>" class="fancy"><img  style="<?=$imgStyle?>" src="<?= $imagePath ?>"  /></a>
	
	
	</div>
<?php $this->placeholder('toolBar')->captureEnd();?>

<style>
.seoButtons
{
	height: 20px;padding: 3px;width: 95%;
}
</style>

<script>

$(document).ready(function()
{
	var activeDate = new Date(); 
    $("#date").datepicker({showStatus:true,yearRange: '2010:2011',defaultDate: activeDate,firstDay: 0,inline: true,showOtherMonths: true});
});


function mainNewsCheckboxClick(obj)
{
	$('#moreDialog').fadeOut(); 
	if ($(obj).attr('checked')==true) 
	{
		$('#PressRelise').val('1');
	}
	else
	{
		$('#PressRelise').val('0');
	} 
}
</script> 


<div class="glowBox" id="metaDialog" style="width: 200px;display: none;position: absolute;right: 15px;">
    <p>Title:<br />        <input class="invivo seoButtons"   name="wsx" value="wsx cderf" type="text" /> </p>
    <p>Keywords:<br />     <input class="invivo seoButtons"   name="wsx" value="wsx cderf" type="text" /> </p>
    <p>Descrioption:<br /> <input class="invivo seoButtons"   name="wsx" value="wsx cderf" type="text" /> </p>
    <p><input type="button" class="button" value="Принять" onclick="$('.glowBox').fadeOut();" /></p>
</div>

<div class="glowBox" id="moreDialog" style="width: 200px;display: none;position: absolute;right: 15px;">
    <input type="checkbox"  <?php  if ($this->Row['PressRelise']) echo "checked='checked'" ?>  onchange="mainNewsCheckboxClick(this)" /> Важная
</div>


<script type="text/javascript" src="<?php echo $this->baseUrl("stuff/editor/ckeditor/ckeditor.js");?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl("stuff/editor/fck.js");?>"></script>



<style>
<!--
.panel tr
{
	padding-bottom: 20px;
}
-->
</style>

<form action="" method="post" id="newsEdit" enctype="multipart/form-data">
<input  type="hidden"  name="PressRelise" id="PressRelise"  value="<?= ($this->Row['PressRelise'])?"1":"0" ?>"  />

<div style="float: right;"><input  id='date' type="text"  style="border: none;background: none;" name="date" value="<?php echo mb_substr($this->Row['Date'],0,strpos($this->Row['Date'],' ')) ?>"/></div>


<p> 
	<span class="fieldTitle">Заголовок:</span>  
	<input style="width: 100%; height:20px;padding:2px;padding-left: 5px;" type="text" name="title" class="invivo" value="<?php echo htmlentities( $this->Row['Title'],ENT_QUOTES,'UTF-8'); ?>"  />
</p>


<p> 
	<span class="fieldTitle">Коротко:</span>  
	<textarea name="teaser" rows="2" class="invivo" cols="100" style="width: 100%; font-weight: normal;font-size: 14px;"><?php echo htmlentities( $this->Row['Teaser'],ENT_QUOTES,'UTF-8'); ?></textarea> 
</p>


<p> 
	<span class="fieldTitle">Текст:</span>  
	<textarea name="text" rows="100"  cols="50" style="height: 1000px"><?php echo htmlentities( $this->Row['Text'],ENT_QUOTES,'UTF-8'); ?></textarea> 
</p>




<table class="panel">

<tr>
<td>Изображение</td>
<td>
<?php if (!empty($this->Row['Picture']))
{
?>
<img src="<?php echo $this->baseUrl("images/thumb_small/" . $this->Row['Picture']) ;  ?>"  style="padding: 3px;border: 1px solid #ccc" /><br />
<?php 
}
?>
<input id='photo' type="file" name="photo" value=""/></td>
</tr>

</table>
</form>
